package org.example.service.domain.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.example.domain.entity.SocialUserRel;
import org.example.service.domain.SocialUserRelService;
import org.example.mapper.SocialUserRelMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author YINDINGJIE
* @description 针对表【social_user_rel(第三方社交软件与系统用户关系表)】的数据库操作Service实现
* @createDate 2023-11-29 13:55:49
*/
@Service
public class SocialUserRelServiceImpl extends ServiceImpl<SocialUserRelMapper, SocialUserRel>
    implements SocialUserRelService{

    @Override
    public List<SocialUserRel> selectBySocialId(String socialId) {
        return lambdaQuery().eq(SocialUserRel::getSocialId, socialId)
                .list();
    }

    @Override
    public SocialUserRel selectBySocialIdAndType(String socialId, Integer loginType) {
        return lambdaQuery().eq(SocialUserRel::getSocialId, socialId)
                .eq(SocialUserRel::getType, loginType)
                .one();
    }

    @Override
    public SocialUserRel selectBySocialIdAndLoginType(String socialId, Integer loginType) {
        return lambdaQuery().eq(SocialUserRel::getSocialId, socialId)
                .eq(SocialUserRel::getType, loginType)
                .one();
    }

}




